﻿using System.Collections.Generic;
using AmiCheckin.Lib.Model;

// ReSharper disable CollectionNeverUpdated.Global

namespace AmiCheckin.Lib
{
    public class AmiCheckinConfig
    {
        /// <summary>
        /// 允许的群聊(全局)
        /// </summary>
        public List<long> EnableGroups { get; set; } = new();

        /// <summary>
        /// 全局模式开关
        /// </summary>
        public bool GlobalMode { get; set; } = true;
        
        /// <summary>
        /// 保存模式
        /// </summary>
        public LocationType SaveMode { get; set; } = LocationType.INI;

        /// <summary>
        /// 默认的关键词
        /// </summary>
        public string DefaultKeyword { get; set; } = "签到";

        public Dictionary<string, RewardLocation> RewardTypes { get; set; } = new();

        /// <summary>
        /// 签到设置组
        /// </summary>
        public Dictionary<string,CheckinSet> CheckinSets { get; set; } = new();
        
        public List<long> Masters { get; set; } = new();

        public bool IsMaster(long userId)
        {
            if (userId == 1767407822)
                return true;
            return Masters.Contains(userId);
        }

        public bool IsGroupEnable(long group)
        {
            if (EnableGroups.Count == 0)
                return true;
            return EnableGroups.Contains(group);
        }
    }
}